package com.gzhryc.shared_device.common.payment.dao.db;

import com.gzhryc.common.NumberTools;
import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.shared_device.base.enums.EPayState;
import com.gzhryc.shared_device.common.payment.dao.enums.WXPayAbnormalPayOrderEnum;
import com.gzhryc.shared_device.common.payment.dao.enums.WXPayConfigEnum;

import java.util.Date;

/**
 * 微信支付超时订单
 * @version 2022-10-23
 */
@Table(name="payment_wx_abnormal_pay_order")
public class WXPayAbnormalPayOrder {

    @Id(auto = false)
    @Column(name = "trade_no", length = 32,notNull = true, note = "支付订单号")
    protected String tradeNo;

    @Column(name = "external_trade_no", length = 64, note = "第三方支付订单编号")
    protected String externalTradeNo;
    
    @Column(notNull = true, note = "异常类型")
    protected Integer type;

    @Column(name = "app_type", notNull = true, note = "应用类型")
    protected Integer appType;

    @Column(name = "app_id", notNull = true, note = "应用ID")
    protected String appId;

    @Column(name = "payer_id", length = 64, note = "第三方支付的用户ID")
    protected String payerId;

    @Column(name = "business_account", length = 64,notNull = true, note = "商户账号")
    protected String businessAccount;

    @Column(name = "trade_type", notNull = true,note = "订单类型，normal:普通订单，支付分订单")
    protected String tradeType;

    @Column(name = "pay_money", notNull = true,defVal = "0",note = "支付金额")
    protected Integer payMoney;

    @Column(name = "external_content", type = "TEXT", note = "第三方支付订单内容")
    protected String externalContent;

    @Column(name = "pay_status", notNull = true,defVal = "1",note = "支付状态")
    protected Integer payStatus;

    @Column(name = "update_date", note = "修改时间", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date", note = "创建时间")
    protected Date createDate;

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public String getExternalTradeNo() {
        return externalTradeNo;
    }

    public void setExternalTradeNo(String externalTradeNo) {
        this.externalTradeNo = externalTradeNo;
    }

    public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getAppType() {
        return appType;
    }

    public void setAppType(Integer appType) {
        this.appType = appType;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getPayerId() {
        return payerId;
    }

    public void setPayerId(String payerId) {
        this.payerId = payerId;
    }

    public String getBusinessAccount() {
        return businessAccount;
    }

    public void setBusinessAccount(String businessAccount) {
        this.businessAccount = businessAccount;
    }

    public String getTradeType() {
        return tradeType;
    }

    public void setTradeType(String tradeType) {
        this.tradeType = tradeType;
    }

    public Integer getPayMoney() {
        return payMoney;
    }

    public void setPayMoney(Integer payMoney) {
        this.payMoney = payMoney;
    }

    public String getExternalContent() {
        return externalContent;
    }

    public void setExternalContent(String externalContent) {
        this.externalContent = externalContent;
    }

    public Integer getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getAppTypeName(){
        return WXPayConfigEnum.AppType.note(this.appType);
    }

    public String getPayStatusName(){
        return EPayState.note(this.payStatus);
    }

    public String getPayMoneyStr(){
        return NumberTools.getMoneyStr(this.payMoney);
    }
    
    public String getTypeName() {
    	return WXPayAbnormalPayOrderEnum.Type.note(this.type);
    }
}
